package com.test.daily.leetcode.y2022.m07.day0705.v06;

/**
 * @descriptions:
 * @author: Tom
 * @date: 2022/7/5 下午 06:47
 * @version: 1.0
 */
public class Solution {
    public int getMax(int[] arr){
        return process(arr, 0, arr.length - 1);
    }
    public int process(int[] arr, int L, int R){
        if(L == R){
            return arr[L];
        }
        int mid = L + ((R-L) >> 1);
        int leftMax = process(arr, L, mid);
        int rightMax = process(arr, mid+1, R);
        return Math.max(leftMax, rightMax);
    }
}
